package test;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;

import org.junit.Test;

import jodd.io.FileUtil;
import jodd.util.StringUtil;
import jodd.util.Wildcard;

public class CheckLanProp {
	private final File file = new File("E:\\workspace_zb20180614\\zb_main\\src\\main\\resources\\L_en.txt");
	@Test
	public void check() throws IOException {
		
		Arrays.asList(FileUtil.readLines(file)).forEach(line->{
//			if(!Wildcard.matchPath(line, "*=*")) {
//				try {
//					throw new Exception("非法键值对:"+line);
//				} catch (Exception e) {
//					// TODO Auto-generated catch block
//					e.printStackTrace();
//				}
//			}
			
			if(Wildcard.matchPath(line, "----------------*") || Wildcard.matchPath(line, "#*") || StringUtil.isAllEmpty(line) || StringUtil.isAllBlank(line)) {
				return ;
			}
			
			String[] split = line.split("=");
			String key = split[0];
			String val = null;
			if(split.length == 2) {//val is maybe empty
				val = split[1];
			}
			System.out.println(key);
			
		});
	}
}
